//-----------------------------------------------------------------------
// <copyright file="BannerLocationService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class BannerLocationService
    {
        #region BannerLocation

        public static void CreateBannerLocation(BannerLocation bannerLocation)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                bannerLocationDAO.CreateBannerLocation(bannerLocation);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateBannerLocationException, ex);
            }
        }        

        public static void UpdateBannerLocation(BannerLocation bannerLocation)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                bannerLocationDAO.UpdateBannerLocation(bannerLocation);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateBannerLocationException, ex);
            }
        }        

        public static void DeleteBannerLocation(long bannerLocationId)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                bannerLocationDAO.DeleteBannerLocation(bannerLocationId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteBannerLocationException, ex);
            }
        }
        
        public static BannerLocation GetBannerLocation(long bannerLocationId)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                return bannerLocationDAO.GetBannerLocation(bannerLocationId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerLocationException, ex);
            }
        }                

        public static BannerLocationCollection GetBannerLocationList(BannerLocationColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                return bannerLocationDAO.GetBannerLocationList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerLocationListException, ex);
            }
        }        

        public static BannerLocationCollection GetBannerLocationList(BannerLocationColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                return bannerLocationDAO.GetBannerLocationList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerLocationListException, ex);
            }
        }        

	    public static BannerLocationCollection GetBannerLocationListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                return bannerLocationDAO.GetBannerLocationListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerLocationListException, ex);
            }
        }        

        public static BannerLocationCollection GetBannerLocationListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                BannerLocationDAO bannerLocationDAO = new BannerLocationDAO();
                return bannerLocationDAO.GetBannerLocationListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetBannerLocationListException, ex);
            }
        }        

        #endregion
    }
}